<!DOCTYPE html>

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="format-detection" content="telephone=no">
    <meta charset="utf-8">
    <title>{$title}</title>
    <link href="http://cdn.bootcss.com/meyer-reset/2.0/reset.min.css" rel="stylesheet">
	
<link href="{$_W['siteroot']}app/{php echo str_replace('./', '', url('utility/style'))}" rel="stylesheet">
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script src="{$_W['siteroot']}app/resource/js/require.js"></script>
	<script src="{$_W['siteroot']}app/resource/js/app/config.js"></script>
	<script type="text/javascript" src="{$_W['siteroot']}app/resource/js/lib/jquery-1.11.1.min.js"></script>
	<script type="text/javascript">
	if(navigator.appName == 'Microsoft Internet Explorer'){
		if(navigator.userAgent.indexOf("MSIE 5.0")>0 || navigator.userAgent.indexOf("MSIE 6.0")>0 || navigator.userAgent.indexOf("MSIE 7.0")>0) {
			alert('您使用的 IE 浏览器版本过低, 推荐使用 Chrome 浏览器或 IE8 及以上版本浏览器.');
		}
	}
	{php define('HEADER', true);}
	window.sysinfo = {
{if !empty($_W['uniacid'])}
		'uniacid': '{$_W['uniacid']}',
{/if}
{if !empty($_W['acid'])}
		'acid': '{$_W['acid']}',
{/if}
{if !empty($_W['openid'])}
		'openid': '{$_W['openid']}',
{/if}
{if !empty($_W['uid'])}
		'uid': '{$_W['uid']}',
{/if}
		'siteroot': '{$_W['siteroot']}',
		'siteurl': '{$_W['siteurl']}',
		'attachurl': '{$_W['attachurl']}',
		'attachurl_local': '{$_W['attachurl_local']}',
{if defined('MODULE_URL')}
		'MODULE_URL': '{MODULE_URL}',
{/if}
		'cookie' : {'pre': '{$_W['config']['cookie']['pre']}'}
	};
	
	// jssdk config 对象
	jssdkconfig = {php echo json_encode($_W['account']['jssdkconfig']);} || {};
	
	// 是否启用调试
	jssdkconfig.debug = false;
	
	jssdkconfig.jsApiList = [
		'checkJsApi',
		'onMenuShareTimeline',
		'onMenuShareAppMessage',
		'onMenuShareQQ',
		'onMenuShareWeibo',
		'hideMenuItems',
		'showMenuItems',
		'hideAllNonBaseMenuItem',
		'showAllNonBaseMenuItem',
		'translateVoice',
		'startRecord',
		'stopRecord',
		'onRecordEnd',
		'playVoice',
		'pauseVoice',
		'stopVoice',
		'uploadVoice',
		'downloadVoice',
		'chooseImage',
		'previewImage',
		'uploadImage',
		'downloadImage',
		'getNetworkType',
		'openLocation',
		'getLocation',
		'hideOptionMenu',
		'showOptionMenu',
		'closeWindow',
		'scanQRCode',
		'chooseWXPay',
		'openProductSpecificView',
		'addCard',
		'chooseCard',
		'openCard'
	];
	
	</script>
	
	<script>
	function _removeHTMLTag(str) {
		if(typeof str == 'string'){
			str = str.replace(/<script[^>]*?>[\s\S]*?<\/script>/g,'');
			str = str.replace(/<style[^>]*?>[\s\S]*?<\/style>/g,'');
			str = str.replace(/<\/?[^>]*>/g,'');
			str = str.replace(/\s+/g,'');
			str = str.replace(/&nbsp;/ig,'');
		}
		return str;
	}
	</script>
    <style>
    html {
        background-color: #f8f7f5;
    }
    body {
        background: #f8f7f5;
        color: #222;
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        height: 100%;
        padding: 15px 15px 0;
        position: relative;
    }
    a {
        color: #4a8bc2;
    }
    .page {
        padding: 15px;
    }
    .page .page-error, .page .page-loading {
        line-height: 30px;
        position: relative;
        text-align: center;
    }
    .btn {
        background-color: #fcfcfc;
        border: 1px solid #cccccc;
        border-radius: 5px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        color: #222;
        cursor: pointer;
        display: block;
        font-size: 15px;
        font-weight: bold;
        margin: 15px 0;
        moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        padding: 10px;
        text-align: center;
        text-decoration: none;
        webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    }
    #activity-detail .page-bizinfo .header #activity-name {
        color: #000;
        font-size: 24px;
        font-weight: 400;
        word-break: normal;
        word-wrap: break-word;
        margin-bottom: 14px;
        line-height: 1.4;
    }

    .activity-meta {
        display: inline-block;
        vertical-align: middle;
        margin-right: 8px;
        margin-bottom: 10px;
        color: #8c8c8c;
        font-size: 16px;
    }
    .activity-meta.no-extra {
        margin-left: 0;
    }
    .activity-info {
        margin-bottom: 18px;
    }
    .activity-info .text-ellipsis {
        display: inline-block;
        max-width: 104px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    a.activity-meta {
        text-decoration: none;
        outline: 0;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    }
    a.activity-meta:active {

        /*background-color:#CACACA;border-radius:10px;box-shadow:inset 0 1px 1px #777;*/

        color: #242424;
    }
    #activity-detail .page-content {
        margin: 18px 0 0;
        padding-bottom: 18px;
    }
    #activity-detail .page-content .media {
        margin-bottom: 10px;
    }
    #activity-detail .page-content .media img {
        width: 100%;
    }
    #activity-detail .page-content .text {
        color: #3e3e3e;
        line-height: 1.5;
        width: 100%;
        overflow: hidden;
        zoom: 1;
    }
    #activity-detail .page-content .text p {
        min-height: 1.5em;
        word-break: break-all;
    }
    #activity-list .header {
        font-size: 20px;
    }
    #activity-list .page-list {
        border: 1px solid #ccc;
        border-radius: 5px;
        margin: 18px 0;
        overflow: hidden;
    }
    #activity-list .page-list .line.btn {
        border-radius: 0;
        margin: 0;
        text-align: left;
    }
    #activity-list .page-list .line.btn .checkbox {
        height: 25px;
        line-height: 25px;
        padding-left: 35px;
        position: relative;
    }
    .vm {
        vertical-align: middle;
    }
    .tc {
        text-align: center;
    }
    .db {
        display: block;
    }
    .dib {
        display: inline-block;
    }
    .b {
        font-weight: 700;
    }
    .clr {
        clear: both;
    }
    .text img {
        max-width: 100% !important;
        height: auto !important;
    }
    .page-toolbar {
        padding-top: 18px;
        overflow: hidden;
        *zoom: 1;
    }
    .page-toolbar a {
        color: #607FA6;
        font-size: 16px;
        text-decoration: none;
        text-shadow: 0 1px #ffffff;
        -webkit-text-shadow: 0 1px #ffffff;
        -moz-text-shadow: 0 1px #ffffff;
        margin-right: 10px;
    }
    .page-url {
        float: left;
    }
    .page-toolbar a.page-imform {
        float: right;
        color: #7B7B7B;
    }
    .selectTdClass {
        background-color: #edf5fa !important
    }
    table.noBorderTable td, table.noBorderTable th, table.noBorderTable caption {
        border: 1px dashed #ddd !important
    }
    table {
        margin-bottom: 10px;
        border-collapse: collapse;
        display: table;
    }
    td, th {
        padding: 5px 10px;
        border: 1px solid #DDD;
    }
    caption {
        border: 1px dashed #DDD;
        border-bottom: 0;
        padding: 3px;
        text-align: center;
    }
    th {
        border-top: 2px solid #BBB;
        background: #F7F7F7;
    }
    .ue-table-interlace-color-single {
        background-color: #fcfcfc;
    }
    .ue-table-interlace-color-double {
        background-color: #f7faff;
    }
    td p {
        margin: 0;
        padding: 0;
    }
    .pagebreak {
        display: block;
        clear: both !important;
        cursor: default !important;
        width: 100% !important;
        margin: 0;
    }
    #account-info {
        color: #4a8bc2;
        font-size: 16px;
        text-decoration: none;
    }

    @media screen and (min-width:1000px) {
        body {
            padding: 0;
            font-family: '宋体';
            background: #fff;
        }
        .page-bizinfo, #activity-detail .page-content {
            width: 700px;
            margin: 0 auto;
            padding: 20px 20px 0;
        }
        .page-bizinfo {
            border-bottom: none;
        }
        #activity-detail .page-content {
            padding-top: 0;
        }
        .page-bizinfo .header a.activity-meta {
            vertical-align: middle;
        }
        #activity-detail .page-content .media img {
            width: 100%;
        }
        #activity-detail .page-bizinfo .header #activity-name {
            padding-bottom: 10px;
            border-bottom: 1px dotted #ccc;
        }
        #activity-detail .page-content .text {
            min-height: 350px;
        }
        #activity-detail .page-content .text p {
            line-height: 2em;
            word-break: break-all;
        }
        #activity-detail .page-content .media {
            margin: -2px 0px 18px 0;
        }
    }
    .top-page-container {
        display: none;
    }
    html, body {
        min-height: 100%;
    }

    </style>
</head>
<body id="activity-detail">
    <div class="top-page-container" style="display: block;">
        <div class="page-bizinfo">
            <div class="header">
                <h1 id="activity-name">{$title}</h1>
                <p class="activity-info">
                    <span id="post-date" class="activity-meta">{php echo date("Y-m-d", $detail['createtime']);}</span>
                   {if !empty($detail['author'])}<span id="author-info" class="activity-meta">{$detail['author']}</span>{/if}
					{if !empty($subscribeurl)}<a href="{$subscribeurl}"  id="account-info" class="activity-meta">{$_W['account']['name']}</a>{/if}
                </p>
            </div>
        </div>
        <div class="page-content">
            <div class="weixin-content">
               
                <div class="text">
                     {$detail['content']}
                </div>
            </div>
            <p class="page-toolbar">
			{if !empty($detail['source'])}<a href="{$detail['source']}">阅读原文</a>{/if}
           
                <span style="color: #8c8c8c;">阅读 <span id="pv">{$detail['click']}</span></span>
            </p>
        </div>
    </div>

<?php
	$_share['title'] = !empty($_share['title']) ? $_share['title'] : $_W['account']['name'];
	$_share['imgUrl'] = !empty($_share['imgUrl']) ? $_share['imgUrl'] : '';
	if(isset($_share['content'])){
		$_share['desc'] = $_share['content'];
		unset($_share['content']);
	}
	$_share['desc'] = !empty($_share['desc']) ? $_share['desc'] : '';
	$_share['desc'] = preg_replace('/\s/i', '', str_replace('	', '', cutstr(str_replace('&nbsp;', '', ihtmlspecialchars(strip_tags($_share['desc']))), 60)));
	if(empty($_share['link'])) {
		$_share['link'] = '';
		$query_string = $_SERVER['QUERY_STRING'];
		if(!empty($query_string)) {
			parse_str($query_string, $query_arr);
			$query_arr['u'] = $_W['member']['uid'];
			$query_string = http_build_query($query_arr);
			$_share['link'] = $_W['siteroot'].'app/index.php?'. $query_string;
		}
	}
?>
	<script type="text/javascript">
	
	wx.config(jssdkconfig);
	
	var $_share = {php echo json_encode($_share);};
	
	if(typeof sharedata == 'undefined'){
		sharedata = $_share;
	} else {
		sharedata['title'] = sharedata['title'] || $_share['title'];
		sharedata['desc'] = sharedata['desc'] || $_share['desc'];
		sharedata['link'] = sharedata['link'] || $_share['link'];
		sharedata['imgUrl'] = sharedata['imgUrl'] || $_share['imgUrl'];
	}

	function tomedia(src) {
		if(typeof src != 'string')
			return '';
		if(src.indexOf('http://') == 0 || src.indexOf('https://') == 0) {
			return src;
		} else if(src.indexOf('../addons') == 0 || src.indexOf('../attachment') == 0) {
			src=src.substr(3);
			return window.sysinfo.siteroot + src;
		} else if(src.indexOf('./resource') == 0) {
			src=src.substr(2);
			return window.sysinfo.siteroot + 'app/' + src;
		} else if(src.indexOf('images/') == 0) {
			return window.sysinfo.attachurl+ src;
		}
	}
	
	if(sharedata.imgUrl == ''){
		var _share_img = $('body img:eq(0)').attr("src");
		if(_share_img == ""){
			sharedata['imgUrl'] = window.sysinfo.attachurl + 'images/global/wechat_share.png';
		} else {
			sharedata['imgUrl'] = tomedia(_share_img);
		}
	}
	
	if(sharedata.desc == ''){
		var _share_content = _removeHTMLTag($('body').html());
		if(typeof _share_content == 'string'){
			sharedata.desc = _share_content.replace($_share['title'], '')
		}
	}
	
	wx.ready(function () {
		wx.onMenuShareAppMessage(sharedata);
		wx.onMenuShareTimeline(sharedata);
		wx.onMenuShareQQ(sharedata);
		wx.onMenuShareWeibo(sharedata);
	});
	{if $controller == 'site' && $action == 'site'}
		$('#category_show').click(function(){
			$('.head .order').toggleClass('hide');
			return false;
		});
		//文章点击和分享加积分
		{if !empty($_GPC['u'])}
			var url = "{php echo url('site/site/handsel/', array('id' => $detail['id'], 'action' => 'click', 'u' => $_GPC['u']), true);}";
			$.post(url, function(dat){});
		{/if}
		sharedata.success = function(){
			var url = "{php echo url('site/site/handsel/', array('id' => $detail['id'], 'action' => 'share'));}";
			$.post(url, function(dat){});
		}
	{/if}
	</script>
	<script>
		$(function(){
			if($('.quick')!=null && $('.quick')!=''){
				var h = $('.quick').height()+'px';
				$('body').css("padding-bottom",h);
			}else{
				$('body').css("padding-bottom", "0");
			}
		});
	</script>



</body>

</html>